/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - T1
 * <p>Powered by webrx On 2021-12-23 17:40:32
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T1 {
    public static void main(String[] args) {

        //建立线程实例
        var t2 = new Thread(() -> {
            //线程要执行的代码
            for (int i = 0; i < 10; i++) {
                var tn = Thread.currentThread().getName();
                System.out.printf("%s:%d%n", tn, i);
            }
        });
        t2.setPriority(Thread.MAX_PRIORITY);
        t2.setName("t2线程");
        t2.start();

        for (int i = 0; i < 10; i++) {
            var tn = Thread.currentThread().getName();
            System.out.printf("%s:%d%n", tn, i);
        }
    }
}
